package com.activemanager.healthGadget;

import java.io.InputStream;

import com.activemanager.myHealthProfile.FirstFragment;
import com.example.android.navigationdrawerexample.R;
import com.example.android.navigationdrawerexample.R.layout;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

public class T2Fragment  extends Fragment {
	public static final String ARG_PAGE = "page";
	
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		View rootView = inflater.inflate(R.layout.t2, container, false);
		initPic(rootView);
		return rootView;
	}
	
	 private void initPic(View rootView) {
		// TODO Auto-generated method stub
		 BitmapFactory.Options opt = new BitmapFactory.Options();
			opt.inPreferredConfig = Bitmap.Config.RGB_565;
			opt.inPurgeable = true;
			opt.inInputShareable = true;
			
			ImageView img2 = (ImageView) rootView.findViewById(R.id.imageView1);
			InputStream is2 = getActivity().getResources().openRawResource(
					R.drawable.u33_normal);
			Bitmap bit2 = BitmapFactory.decodeStream(is2, null, opt);
			img2.setImageResource(R.drawable.u33_normal);
			
			ImageView img3 = (ImageView) rootView.findViewById(R.id.imageView2);
			InputStream is3 = getActivity().getResources().openRawResource(
					R.drawable.u35_normal);
			Bitmap bit3 = BitmapFactory.decodeStream(is3, null, opt);
			img3.setImageBitmap(bit3);
	}

	public static T2Fragment newInstance(String text) {

		 T2Fragment f = new T2Fragment();
	        Bundle b = new Bundle();
	        b.putString("msg", text);

	        f.setArguments(b);

	        return f;
	    }
}
